<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>四则运算</title>
    <!-- Bootstrap -->
    <js href="__PUBLIC__/assets/js/jquery.min.js"/>
    <css href="__PUBLIC__/assets/css/amazeui.min.css"/>
    <css href="__PUBLIC__/assets/css/dataTables.bootstrap.css"/>
    <!-- <css href="__PUBLIC__/assets/css/amazeui.flat.min.css"/> -->
    <js href="__PUBLIC__/assets/js/amazeui.min.js"/>
    <js href="__PUBLIC__/assets/js/jquery.dataTables.min.js"/>
    <js href="__PUBLIC__/assets/js/dataTables.bootstrap.js" />
    <js href="__PUBLIC__/assets/js/echarts-all.js"/>

    <style type="text/css">
	    header {
	        text-align: center;
	    }
      .am-topbar-btn a {
        color: #fff;
      }
      .am-topbar-btn a:hover {
        color: #fff;
      }
      .am-topbar-btn a:active {
        color: #fff;
      }
      .am-topbar-btn a:link {
        color: #fff;
      }
    </style>

    <script>
        baseUrl = '__ROOT__';
        $.ajax({
            url: '{:U("Home/Student/getLetterNum/")}',
            type: 'post',
            dataType: 'json'
        })
        .success(function(data){
            $('#letter_num').html(data.num);
        });

        $('#nav_bar li').each(function(){
            console.log($(this));
            if(window.location.pathname){

            }
        });

    </script>
</head>
<body>
    <header class="am-topbar am-topbar-fixed-top">
        <div class="am-container">
            <h1 class="am-topbar-brand">学生模块 </h1>
            <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-secondary am-show-sm-only" data-am-collapse="{target: '#collapse-head'}">
                <span class="am-sr-only">导航切换</span>
                <span class="am-icon-bars"></span>
            </button>
            <div class="am-collapse am-topbar-collapse" id="collapse-head">
                <ul id="nav_bar" class="am-nav am-nav-pills am-topbar-nav">
                    <li><a href="{:U("Home/Student/index")}">首页</a></li>
                    <li><a href="{:U("Home/Student/questionList")}">习题</a></li>
                    <li class="am-dropdown" data-am-dropdown>
                        <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;">
                            考试 <span class="am-icon-caret-down"></span>
                        </a>
                        <ul class="am-dropdown-content">
                            <li><a href="{:U("Home/Student/examList")}">已完成</a></li>
                            <li><a href="{:U("Home/Student/processingExam")}">进行中</a></li>
                        </ul>
                    </li>
                <if condition="session('student')">
                    <li><a href="{:U("Home/Student/letter")}">通知 <span id="letter_num" class="am-badge am-badge-warning"></span></a></li>
                <else />
                </if>
                </ul>

                <if condition="session('student')">
                    <div class="am-topbar-right">
                        <button id="logout-btn" class="am-btn am-btn-secondary am-topbar-btn am-btn-sm">
                            <span class="am-icon-pencil"></span>
                            <a href="{:U("/Home/Student/doLogout")}"> 注销</a>
                        </button>
                    </div>
                    <div class="am-topbar-right">
                        <button class="am-btn am-btn-secondary am-topbar-btn am-btn-sm">
                            <span class="am-icon-user"></span>
                            <a href="#"> {:I('session.student')['username']}</a>
                        </button>
                    </div>
                <else />
                    <div class="am-topbar-right">
                        <button class="am-btn am-btn-secondary am-topbar-btn am-btn-sm">
                            <span class="am-icon-user-plus"></span>
                            <a href="{:U("/Home/Student/register")}"> 注册</a>
                        </button>
                    </div>
                    <div class="am-topbar-right">
                        <button class="am-btn am-btn-secondary am-topbar-btn am-btn-sm">
                            <span class="am-icon-pencil"></span>
                            <a href="{:U("/Home/Student/login")}"> 登录</a>
                        </button>
                    </div>
                </if>
            </div>
        </div>
    </header>
